home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / util307.arc / SETVAR.DOC < prev    next >
Text File  |  1987-03-04  |  1KB  |  34 lines

  1.  
  2.  
  3.      SETVAR -- Copyright (C) 1984 by Darryl E. Rubin
  4.  
  5.      This program reads the standard input and assigns that value
  6. to the environment variable named on the command line.
  7.  
  8. o   If the named variable does not exist, it is created.
  9.  
  10. o   If it does exist, it is deleted and recreated with the 
  11.     new value
  12.  
  13. o   The variable is not entered into the environment if
  14.     there isn't enough room for it and its value.
  15.  
  16. Example:  echo test| setvar VAR   ; same as SET VAR=test
  17.  
  18. On return to command.com, SETVAR sets the errorlevel equal
  19. to the length of the string assigned to the variable
  20. ( 0 if the variable could not be created or assigned ).  In
  21. the above example, SETVAR returns an errorlevel of 4.
  22.  
  23. Note that SETVAR does not fold its command line argument
  24. to upper case, so be careful!  Saying SETVAR test creates
  25. a different variable than "SETVAR TEST".  The former
  26. creates a variable "test" that cannot be accessed via the
  27. DOS "SET" command ( SET folds its arguments to upper case ).
  28.  
  29. This can be particularly useful in batch files for multiple
  30. responses and tests.  i.e. this helps batch become a true
  31. language.
  32.  
  33. The program was downloaded from the COMPUTER LANGUAGE 
  34. bulletin board in California.(MLM)